
#pragma once

#include "sglframe.h"

class SglRender
{

public:

	typedef const SglFrame::BLOCK	*PBLOCK;
	typedef const SglFrame::BUFFER	*PBUFFER;

	SglRender();
	virtual ~SglRender();

	INT GetError(VOID) const;

	virtual BOOL Create(HWND hWnd, INT nWidth, INT nHeight, BOOL bFullScreen) = 0;
	virtual BOOL BeginDraw() = 0;
	virtual BOOL Draw(PBUFFER pBuffer, COLORREF dwBgColor) = 0;
	virtual BOOL EndDraw() = 0;
	virtual BOOL DrawPixel(INT nX, INT nY, COLORREF dwColor, BYTE byAlpha) = 0;
	virtual BOOL Render(LPCRECT pRect) = 0;
	virtual VOID Destroy(VOID) = 0;

protected:

	SGL_ERROR	m_Error;

	BOOL CheckBuffer(PBUFFER pBuffer, BOOL &bIgnore);

};
